/**
 * 
 */
package by.imotaeva.printing_services.datamodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;

/**
 * @author Inna
 *
 */
@Entity
public class BookOrder {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@MapsId
	@OneToOne(fetch = FetchType.LAZY, optional = false, cascade = {
			CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(nullable = false, updatable = false, name = "id")
	private PrintingProductOrder printingProductOrder;

	@Column
	private Integer numberOfPages;

	@Column
	private String colorfulnessBlock;

	@Column
	private String colorfulnessCover;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Paper.class)
	@JoinColumn(nullable = true, updatable = true, name = "paperForBlock")
	private Paper paperForBlock;

	@Column
	private Double amountForBlock;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Paper.class)
	@JoinColumn(nullable = true, updatable = true, name = "paperForCover")
	private Paper paperForCover;

	@Column
	private Double amountForCover;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Carboard.class)
	@JoinColumn(nullable = true, updatable = true, name = "carboardForCover")
	private Carboard carboardForCover;

	@Column
	private Double amountCarboard;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public PrintingProductOrder getPrintingProductOrder() {
		return printingProductOrder;
	}

	public void setPrintingProductOrder(
			PrintingProductOrder printingProductOrder) {
		this.printingProductOrder = printingProductOrder;
	}

	public Integer getNumberOfPages() {
		return numberOfPages;
	}

	public void setNumberOfPages(Integer numberOfPages) {
		this.numberOfPages = numberOfPages;
	}

	public String getColorfulnessBlock() {
		return colorfulnessBlock;
	}

	public void setColorfulnessBlock(String colorfulnessBlock) {
		this.colorfulnessBlock = colorfulnessBlock;
	}

	public String getColorfulnessCover() {
		return colorfulnessCover;
	}

	public void setColorfulnessCover(String colorfulnessCover) {
		this.colorfulnessCover = colorfulnessCover;
	}

	public Paper getPaperForBlock() {
		return paperForBlock;
	}

	public void setPaperForBlock(Paper paperForBlock) {
		this.paperForBlock = paperForBlock;
	}

	public Double getAmountForBlock() {
		return amountForBlock;
	}

	public void setAmountForBlock(Double amountForBlock) {
		this.amountForBlock = amountForBlock;
	}

	public Paper getPaperForCover() {
		return paperForCover;
	}

	public void setPaperForCover(Paper paperForCover) {
		this.paperForCover = paperForCover;
	}

	public Double getAmountForCover() {
		return amountForCover;
	}

	public void setAmountForCover(Double amountForCover) {
		this.amountForCover = amountForCover;
	}

	public Carboard getCarboardForCover() {
		return carboardForCover;
	}

	public void setCarboardForCover(Carboard carboardForCover) {
		this.carboardForCover = carboardForCover;
	}

	public Double getAmountCarboard() {
		return amountCarboard;
	}

	public void setAmountCarboard(Double amountCarboard) {
		this.amountCarboard = amountCarboard;
	}

}
